//
//  OtherLocationCityNameCell.swift
//  MoyoungDevice
//
//  Created by 易先生 on 2022/8/23.
//

import UIKit

class OtherLocationCityNameCell: TableViewCell {

	override func makeUI() {
		super.makeUI()
        
        contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(14.5)
            make.leading.equalToSuperview().offset(20)
            make.trailing.equalToSuperview().offset(-64)
            make.bottom.equalToSuperview().offset(-14.5)
        }
                
		contentView.addSubview(selectImageView)
        selectImageView.snp.makeConstraints { make in
			make.trailing.equalToSuperview().offset(-30)
			make.centerY.equalToSuperview()
		}
	}
    
    func bind(viewModel: OtherCityCellViewModel) {
        self.titleLabel.text = viewModel.cityName
        self.selectImageView.isHidden = !viewModel.isSelect
    }
    
    lazy var titleLabel: Label = {
        let titleLabel = Label()
        titleLabel.textColor = R.color.common_3_text()
        titleLabel.numberOfLines = 0
        titleLabel.font = Fonts.systemFont(ofSize: 14)
        return titleLabel
    }()

    
    lazy var selectImageView: UIImageView = {
        let view = UIImageView()
        view.image = R.image.ic_common_pick()
        return view
    }()
}
